package com.hmall.order.web;

import com.hmall.common.client.ItemClient;
import com.hmall.common.dto.Item;
import com.hmall.order.pojo.Order;
import com.hmall.order.service.IOrderDetailService;
import com.hmall.order.service.IOrderService;
import com.hmall.order.vo.ResultParams;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("order")
public class OrderController {

   @Autowired
   private IOrderService orderService;
   @Autowired
   private IOrderDetailService orderDetailService;


   @GetMapping("{id}")
   public Order queryOrderById(@PathVariable("id") Long orderId) {
      return orderService.getById(orderId);
   }

   /**
    * 下单业务
    * @return
    */
   @PostMapping
    public Long SubOrder(@RequestBody ResultParams params){
     return orderService.getOrder(params);
   }

}
